feat: add hosted WebDriver provider support#948
Conversation
|
Size Report
Startup median (7 runs, lower is better):
Top changed chunks:
|
ad75be7 to
b7ec3e3
Compare
|
Reviewed the cloud WebDriver artifact support path. I traced the shipped command route from CLI/typed client input through command projection, daemon lease routing, active-session lease inference, provider runtime artifact lookup, and close/disconnect release payloads. The important paths are covered by tests: active-session artifacts before release, handled-unavailable artifact lookup, provider release payloads, BrowserStack/AWS artifact mapping, CLI text/JSON output, command descriptor routing, and package exports. Checks are green, and the PR body includes live verification for existing BrowserStack and AWS Device Farm sessions without opening new cloud minutes. I do not see remaining actionable blockers; ready for human review/merge judgment. |
d99e4c6 to
f756370
Compare
|
Correction: my previous comment was mangled by shell quoting. The blocker is in src/cli/commands/connection.ts line 318 on the PR head. disconnect reads the active generated connection state, but then calls client.sessions.close with only shutdown. The real client resolves that to the default session when no session override is present, so agent-device disconnect without a session can close default while releasing and removing local state for the generated active session such as adc-android. That can strand the actual provider-backed daemon session/runtime until lease expiry or manual cleanup. Please pass the resolved connected session into close, for example client.sessions.close({ session: connectedSession, shutdown: flags.shutdown }), and add an assertion that active-state disconnect closes the active session rather than default. |
704a764 to
71c7b6a
Compare
5d0732e to
6563089
Compare
|
Re-checked current clean head 6563089 after the prior disconnect blocker. The blocker is addressed: disconnect now closes the resolved active generated session via client.sessions.close({ session: connectedSession, shutdown: flags.shutdown }) before cleanup/release, and the built-CLI provider smoke test asserts the close RPC targets the adc-* active session rather than default before release and state removal. Checks are green. I did not rerun live BrowserStack or AWS minutes in this monitor pass; the remaining provider behavior is covered by the PR tests and should be judged with that residual risk. I do not see an actionable blocker; ready for maintainer review. |
|
Re-checked current clean head bd4cbb4. The delta from the previously reviewed 6563089 head is focused on making hosted WebDriver sessions launchable:
Checks are green. This does not reopen the prior disconnect-session blocker, and I do not see a new actionable blocker; the existing ready-for-human label is still appropriate. |
Summary
Adds hosted WebDriver provider support for BrowserStack and AWS Device Farm without adding Limrun to the CLI surface.
agent-device connectkeeps the existing cloud default,agent-device connect cloudis an explicit alias,connect proxykeeps the direct remote daemon flow, andconnect browserstack/connect aws-device-farmnow create local provider profiles that allocate hosted sessions on firstopen.The provider wiring stays isolated: generated profiles persist non-secret provider selectors, daemon startup composes provider runtimes through the existing request-provider seams, and BrowserStack/AWS session setup delegates to the shared cloud WebDriver runtime. Artifacts remain available through
agent-device artifacts --json, including active-session inference and historical provider-session lookup where supported.This also addresses the code-quality review pass:
CloudWebDriverRuntime, and per-lease request/profile setup happens throughprepareSession.Record<string, unknown>.agent-device/cloud-webdriversubpath and leftover source-only facade were removed, so the daemon still ships the runtime chunk without publishing a large unused SDK declaration surface.phasemode.Agents can connect autonomously when credentials are present up front. BrowserStack uses
BROWSERSTACK_USERNAME/BROWSERSTACK_ACCESS_KEY; AWS Device Farm uses the AWS CLI credential chain, including CI-provided environment credentials, profiles, or web identity role variables. The Hosted Device Providers docs page captures the CI setup and links to official AWS CLI/OIDC guidance.Docs/help now give actionable hosted-provider flows and credential guidance across CLI, JavaScript, and MCP: CLI is the canonical bootstrap path, JavaScript can pass provider config directly through the typed client, and MCP is documented as an operational interface after CLI bootstrap rather than a separate provider-connect surface.
Validation
Verified locally with focused CLI/profile/provider tests, docs/help tests, static checks, package build, and fallow audit.
Latest checks:
pnpm exec vitest run src/utils/__tests__/args.test.ts src/__tests__/cli-help.test.ts src/__tests__/cloud-connect-profile.test.ts src/__tests__/package-exports.test.tspnpm exec vitest run src/__tests__/cloud-connect-profile.test.ts src/__tests__/remote-connection.test.ts src/__tests__/default-cloud-artifact-provider.test.ts src/__tests__/package-exports.test.ts test/integration/provider-scenarios/cloud-webdriver-provider-adapters.test.ts test/integration/provider-scenarios/cloud-webdriver-runtime.test.tspnpm check:quickpnpm buildpnpm check:fallow --base origin/mainnode ./node_modules/oxfmt/bin/oxfmt --write <touched files>git diff --check